package com.alibaba.citrus.ots.sales.plan.functions.salesplan;

import com.alibaba.citrus.ots.common.util.SpringContextUtil;
import com.alibaba.citrus.ots.sales.plan.dto.api.request.PageQueryStrategyFactorRequest;
import com.alibaba.citrus.ots.sales.plan.repository.StrategyFactorRepository;
import com.alibaba.citrus.ots.sales.plan.sdo.StrategyFactorSDO;
import com.alibaba.cz.base.tool.page.PageResult;
import lombok.Getter;
import lombok.Setter;

import java.util.List;

public class StrategyFactorEntity {

    @Getter
    @Setter
    private StrategyFactorSDO strategyFactorSDO;

    private static StrategyFactorRepository strategyFactorRepository;

    static {
        strategyFactorRepository = SpringContextUtil.getBean(StrategyFactorRepository.class);
    }

    public static StrategyFactorEntity of(StrategyFactorSDO strategyFactorSDO) {
        StrategyFactorEntity entity = new StrategyFactorEntity();
        entity.setStrategyFactorSDO(strategyFactorSDO);
        return entity;
    }

    public String doCreate() {
        return strategyFactorRepository.createStrategyFactor(strategyFactorSDO);
    }

    /*public PageResult<List<StrategyFactorSDO>> doPageQuery(PageQueryStrategyFactorRequest pageQueryStrategyFactorRequest) {
        return strategyFactorRepository.pageQueryStrategyFactorList(pageQueryStrategyFactorRequest);
    }*/

    public Integer doEdit() {
        return strategyFactorRepository.editStrategyFactor(strategyFactorSDO);
    }

}
